package com.ship.entity.dto;

/**
 * 返回对象
 */
public class JsonResult<T> {
    private String result;
    private String message;
    private T data;
    private String method;

    public JsonResult() {
        this.setResult(ResultCode.SUCCESS);
        this.setMessage("成功！");

    }

    public JsonResult(ResultCode result, String message, T data) {
        this.setResult(result);
        this.message = message;
        this.data = data;
        this.toString();
    }

    public JsonResult(ResultCode result) {
        this.setResult(result);
        this.setMessage(result.msg());
    }

    public JsonResult(ResultCode status, String message) {
        this.result(status);
        this.setMessage(message);
    }

    public String getResult() {
        return result;
    }

    public void result(ResultCode result) {
        this.result = result.val();
    }
    public void setResult(ResultCode result) {
        this.result = result.val();
    }

    public String getMessage() {
        return message;
    }
    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

}
